home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-06-19 | 3.5 KB | 141 lines |
- package symantec.itools.awt;
-
-
- import java.awt.Color;
- import java.awt.BorderLayout;
- import java.awt.Label;
- import java.awt.LayoutManager;
-
- /**
- * Use a StatusBar to show document status and other information, like the
- * meaning of a button or other interface element in a window. Typically,
- * a status bar appears at the bottom of a window.
- */
- public class StatusBar
- extends BorderPanel
- {
- //--------------------------------------------------
- // constants
- //--------------------------------------------------
-
-
- //--------------------------------------------------
- // class variables
- //--------------------------------------------------
-
-
- //--------------------------------------------------
- // member variables
- //--------------------------------------------------
-
- /**
- * The text to display.
- */
- protected Label text;
- /**
- * The color of the displayed text.
- */
- protected Color textColor;
-
-
- //--------------------------------------------------
- // constructors
- //--------------------------------------------------
-
- /**
- * Constructs a default StatusBar.
- */
- public StatusBar()
- {
- super.setLayout(new BorderLayout());
- add("Center", text = new Label());
- }
-
-
- //--------------------------------------------------
- // accessor methods
- //--------------------------------------------------
-
- /**
- * Sets the text that is displayed.
- * @param s the new text to display
- * @see #getStatusText
- */
- public void setStatusText(String s)
- {
- text.setText(s);
- invalidate();
- }
-
- /**
- * Gets the text currently displayed.
- * @return the text currently displayed
- * @see #setStatusText
- */
- public String getStatusText()
- {
- return text.getText();
- }
-
- /**
- * Sets the color of the text that is displayed.
- * @param s the new color of the text to display
- * @see #getStatusTextColor
- */
- public void setStatusTextColor(Color c)
- {
- textColor = c;
- text.setForeground(c);
- invalidate();
- }
-
- /**
- * Gets the text color currently displayed.
- * @return the current color of displayed text
- * @see #setStatusTextColor
- */
- public Color getStatusTextColor()
- {
- return textColor;
- }
-
-
- //--------------------------------------------------
- // event methods
- //--------------------------------------------------
-
-
- //--------------------------------------------------
- // class methods
- //--------------------------------------------------
-
-
- //--------------------------------------------------
- // member methods
- //--------------------------------------------------
-
- /**
- * Takes no action.
- * This is a standard Java AWT method which gets called to specify
- * which layout manager should be used to layout the components in
- * standard containers.
- *
- * Since layout managers CANNOT BE USED with this container the standard
- * setLayout has been OVERRIDDEN for this container and does nothing.
- *
- * @param l the layout manager to use to layout this container's components
- * (IGNORED)
- * @see java.awt.Container#getLayout
- **/
- public void setLayout(LayoutManager l)
- {
- }
-
- /**
- * Clears the text that gets displayed.
- */
- public void clear()
- {
- setStatusText("");
- }
- }